package com.test.selenium.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;

public class InputTestData {
	private boolean debugMode;
	//Shipment
	private String shipperPartyAccount;
	private String consigneePartyAccount;
	private String productCode;
	private String PaymentTerm;
	private String incoTermCode;
	private String Origin;
	private String Destination;
	private String BookedPieces;
	private String BookedWeight;
	private String BookedWeightType;
	//Pieceline
	private String PackageCount;
	private String PackageType;
	private String ShortDescription;
	//ShipCharges
	private String ShipmentChargeTypeCode;
	private String ShipChargeAmount;
	private String ShipChargeCurrencyCode;
	//Movement
	private String ModeCode;
	private String CarrierCode;
	private String MovementTypeCode;
	private String UOM;
	private String PrintingCurrency;
	private String PaymenttermCode;
	private String Shipper;
	private String Consignee;
	private String OriginSiteCode;
	private String OriginPortCode;
	private String DestinationSiteCode;
	private String DestinationPortCode;
	private String FlightNumber;
	//MovementCharges
	private String ChargeCode;
	private String Basis;
	private String CostRate;
	private String PrintRate;
	
	
	public InputTestData() throws IOException {
		FileInputStream file;
		file = new FileInputStream(new File("../selenium/src/Input/SmokeTestAirMode_InputSheet.xls"));
		HSSFWorkbook workbook = new HSSFWorkbook(file);
		HSSFSheet inputSheet = workbook.getSheetAt(0);
		Row row = inputSheet.getRow(1);
		//Shipment
		shipperPartyAccount = row.getCell(0).getStringCellValue().trim();
		consigneePartyAccount = row.getCell(1).getStringCellValue().trim();
		productCode = row.getCell(2).getStringCellValue().trim();
		incoTermCode = row.getCell(3).getStringCellValue().trim();
		PaymentTerm = row.getCell(4).getStringCellValue().trim();
		Origin = row.getCell(5).getStringCellValue().trim();
		Destination = row.getCell(6).getStringCellValue().trim();
		BookedPieces = row.getCell(7).getStringCellValue().trim();
		BookedWeight = row.getCell(8).getStringCellValue().trim();
		BookedWeightType = row.getCell(9).getStringCellValue().trim();
		//Pieceline
		PackageCount = row.getCell(10).getStringCellValue().trim();
		PackageType = row.getCell(11).getStringCellValue().trim();
		ShortDescription = row.getCell(12).getStringCellValue().trim();
		//ShipCharges
		ShipmentChargeTypeCode = row.getCell(13).getStringCellValue().trim();
		ShipChargeAmount = row.getCell(14).getStringCellValue().trim();
		ShipChargeCurrencyCode =row.getCell(15).getStringCellValue().trim();
		//Movement
		ModeCode = row.getCell(16).getStringCellValue().trim();
		CarrierCode = row.getCell(17).getStringCellValue().trim();
		MovementTypeCode = row.getCell(18).getStringCellValue().trim();
		UOM = row.getCell(19).getStringCellValue().trim();
		PrintingCurrency = row.getCell(20).getStringCellValue().trim();
		PaymenttermCode =row.getCell(21).getStringCellValue().trim();
		Shipper = row.getCell(22).getStringCellValue().trim();
		Consignee = row.getCell(23).getStringCellValue().trim();
		OriginSiteCode = row.getCell(24).getStringCellValue().trim();
		OriginPortCode = row.getCell(25).getStringCellValue().trim();
		DestinationSiteCode = row.getCell(26).getStringCellValue().trim();
		DestinationPortCode =row.getCell(27).getStringCellValue().trim();
		FlightNumber = row.getCell(28).getStringCellValue().trim();
		//MovementCharges
		ChargeCode = row.getCell(29).getStringCellValue().trim();
		Basis = row.getCell(30).getStringCellValue().trim();
		CostRate = row.getCell(31).getStringCellValue().trim();
		PrintRate = row.getCell(32).getStringCellValue().trim();
		
		if (debugMode) {
			//Shipment
			System.out.println("shipper: " + shipperPartyAccount);
			System.out.println("consignee: " + consigneePartyAccount);
			System.out.println("productCode: " + productCode);
			System.out.println("incoTermCode: " + incoTermCode);
			System.out.println("PaymentTerm: " + PaymentTerm);
			System.out.println("Origin: " + Origin);
			System.out.println("Destination: " + Destination);
			
			System.out.println("BookedPieces: " + BookedPieces);
			System.out.println("BookedWeight: " + BookedWeight);
			System.out.println("BookedWeightType: " + BookedWeightType);
			//Pieceline
			System.out.println("PackageCount: " + PackageCount);
			System.out.println("PackageType: " + PackageType);
			System.out.println("ShortDescription: " + ShortDescription);
			//ShipCharges
	        System.out.println("ShipmentChargeTypeCode:" + ShipmentChargeTypeCode);
	        System.out.println("ShipChargeAmount:" + ShipChargeAmount);
			System.out.println("ShipChargeCurrencyCode:" + ShipChargeCurrencyCode);
			//Movement
			System.out.println("ModeCode: " + ModeCode);
			System.out.println("CarrierCode: " + CarrierCode);
			System.out.println("MovementTypeCode: " + MovementTypeCode);
			System.out.println("UOM: " + UOM);
			System.out.println("PrintingCurrency: " + PrintingCurrency);
			System.out.println("PaymenttermCode: " + PaymenttermCode);
			System.out.println("Shipper: " + Shipper);
			System.out.println("Consignee: " + Consignee);
			System.out.println("OriginSiteCode: " + OriginSiteCode);
			System.out.println("OriginPortCode: " + OriginPortCode);
			System.out.println("DestinationSiteCode: " + DestinationSiteCode);
			System.out.println("DestinationPortCode: " + DestinationPortCode);
			System.out.println("FlightNumber: " + FlightNumber);
			//MovementCharges
			System.out.println("ChargeCode: " + ChargeCode);
			System.out.println("Basis: " + Basis);
			System.out.println("CostRate: " + CostRate);
			System.out.println("PrintRate: " + PrintRate);
		}
		
		file.close();
	}
	
	//Shipment	
	public String getShipperPartyAccount() {
		return this.shipperPartyAccount;
	}
	
	public String getConsigneePartyAccount() {
		return this.consigneePartyAccount;
	}
	
	public String getProductCode() {
		return this.productCode;
	}	
	
	public String getIncoTermCode() {
		return this.incoTermCode;
	}
	public String getPaymentTerm() {
		return this.PaymentTerm;
	}
	public String getOrigin() {
		return this.Origin;
	}
	public String getDestination() {
		return this.Destination;
	}
	
	public String getBookedPieces() {
		return this.BookedPieces;
	}
	public String getBookedWeight() {
		return this.BookedWeight;
	}
	public String getBookedWeightType() {
		return this.BookedWeightType;
	}
	//Pieceline
	public String getPackageCount() {
		return this.PackageCount;
	}
	public String getPackageType() {
		return this.PackageType;
	}
	public String getShortDescription() {
		return this.ShortDescription;
	}
	//ShipCharges
	public String getShipmentChargeTypeCode() {
		return this.ShipmentChargeTypeCode;
	}
	public String getShipChargeAmount() {
		return this.ShipChargeAmount;
	}
	public String getShipChargeCurrencyCode() {
		return this.ShipChargeCurrencyCode;
	}
	//Movement
	public String getModeCode() {
		return this.ModeCode;
	}
	public String getCarrierCode() {
		return this.CarrierCode;
	}
	public String getMovementTypeCode() {
		return this.MovementTypeCode;
	}
	public String getUOM() {
		return this.UOM;
	}
	public String getPrintingCurrency() {
		return this.PrintingCurrency;
	}
	public String getPaymenttermCode() {
		return this.PaymenttermCode;
	}
	public String getShipper() {
		return this.Shipper;
	}
	public String getConsignee() {
		return this.Consignee;
	}
	public String getOriginSiteCode() {
		return this.OriginSiteCode;
	}
	public String getOriginPortCode() {
		return this.OriginPortCode;
	}
	public String getDestinationSiteCode() {
		return this.DestinationSiteCode;
	}
	public String getDestinationPortCode() {
		return this.DestinationPortCode;
	}
	public String getFlightNumber() {
		return this.FlightNumber;
	}
	//MovementCharges
	public String getChargeCode() {
		return this.ChargeCode;
	}
	public String getBasis() {
		return this.Basis;
	}
	public String getCostRate() {
		return this.CostRate;
	}
	public String getPrintRate() {
		return this.PrintRate;
	}
}
